package string;

public class StringTest {

    public static void main(String[] args) {
/*        String str = "Java2";
        String str2 = new String("Java2");
        String str3 = new String("Java3");

        System.out.println(str == str2);

        String aa = new StringBuilder("aaa").append("bbb").toString();
        String aa1 = "aaabbb";

        String t0 = "a";
        String t1 = "b";
        String t2 = t0 + t1;
        String t3 = "ab";
        System.out.println(t2==t3);*/

        System.out.println("java".getClass().isAssignableFrom(Object.class));
        System.out.println(String.class.isAssignableFrom(Object.class));
        System.out.println(int.class.isAssignableFrom(String.class));
        System.out.println(int.class.isAssignableFrom(Object.class));
        System.out.println(new String("java").getClass());


        String str1 = new StringBuilder("计算机").append("软件").toString();
        String str12 = new StringBuilder("计算").append("机软件").toString();
        System.out.println(str1.intern() == str1);
        System.out.println(str1.intern() == str12.intern());

        String str2 = new StringBuilder("ja").append("va").toString();
        System.out.println(str2.intern() == str2);



        int a = 20;
        int b = 10;
        if (a-- > 20) {
            System.out.println("a-- > 20");
        }

        if (--a < 20) {
            System.out.println("--a < 20");
        }

    }
}
